package com.apesay.controller;

import com.apesay.utils.Constant;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequiresAuthentication
@RequestMapping("/permission")
public class PermissionController extends RestController{
	
	/**
	 * 权限列表	
	 * @return
	 */
	@RequiresAuthentication
	@RequestMapping("/manage")
	public String manage(){
		return "permission/manage";
	}
	/**
	 * 添加权限
	 * @return
	 */
	@RequiresAuthentication
	@RequestMapping("add")
	public String add(){
		return "permission/add";
	}
	@RequiresAuthentication
	@RequestMapping("edit")
	public String edit(String objectId,Model model){
		model.addAttribute(Constant.OBJECTID, objectId);
		return "permission/add";
	}
	
	@Override
	protected String getModel() {
		return Constant.model_backend_permission;
	}
	
}
